
#ifndef __TCPCLIENT_H__
#define __TCPCLIENT_H__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <ctype.h>
#include <unistd.h>
#include <errno.h>

#include <pthread.h>
#include <arpa/inet.h>
#include <sys/socket.h>

#define SERPORT         6666
#define backlogs        10

void perr_exit(const char *s);
int Socket(int domain,int type,int protocol);
int Bind(int sockfd,const struct sockaddr *addr,socklen_t addrlen);
int Listen(int sockfd,int backlog);
int Accept(int sockfd,struct sockaddr *addr,socklen_t *addrlen);
int start_up(const char* ip,int port);
int Connect(int sockfd,const struct sockaddr *addr,socklen_t addrlen);
ssize_t Read(int fd,void *buf,size_t nbytes);
ssize_t Write(int fd,void *buf,size_t nbytes);

#endif // __TCPCLIENT_H__